﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iS3.DAL.Attributes
{
    /// <summary>
    /// 可视化状态
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
    public class PropertyDisplayAttribute:Attribute
    {
        private bool _IsCanIgnore;
        //对象属性简单显示状态时可忽略显示的字段
        public bool IsCanIgnore
        {
            get { return _IsCanIgnore; }
            set { _IsCanIgnore = value; }
        }
        private bool _IsCanOrder;
        //对象属性简单显示状态时可忽略显示的字段
        public bool IsCanOrder
        {
            get { return _IsCanOrder; }
            set { _IsCanOrder = value; }
        }
        private int _MaxLength;
        //对象属性简单显示状态时可忽略显示的字段
        public int MaxLength
        {
            get { return _MaxLength; }
            set { _MaxLength = value; }
        }
        public PropertyDisplayAttribute(bool isCanIgnore,bool isCanOrder,int maxLength)
        {
            this._IsCanIgnore = isCanIgnore;
            this._IsCanOrder = isCanOrder;
            this._MaxLength = maxLength;
        }
        public PropertyDisplayAttribute(bool isCanIgnore, bool isCanOrder)
        {
            this._IsCanIgnore = isCanIgnore;
            this._IsCanOrder = isCanOrder;
            this._MaxLength = -1;   //means no limit
        }
    }
}
